package cn.edu.scau.cmi.zenghanxiong.client;

import java.util.Scanner;
import cn.edu.scau.cmi.zenghanxiong.abstractFactory.factory.*;
import cn.edu.scau.cmi.zenghanxiong.abstractFactory.domainAbstractClass.Meat;

public class AbstractFactoryClient {

	public static void main(String[] args) {
		System.out.println("Please select which brand you want to buy: Wens, Tianbang or Aonong?");
		Scanner scanner = new Scanner(System.in);  
		String brandKind = scanner.next();  
		AbstractFactory factory=null;
		switch(brandKind){
		case "Wens": 
			factory=new WensFactory();break;
		case "Tianbang": 
			factory=new TianbangFactory();break;
		case "Aonong": 
			factory=new AonongFactory();break;
		default:
			System.out.println("sorry, your input is not correct");System.exit(0);
		}

		System.out.println("Please select which product you want to buy: chicken, beef or pork?");
		String productType = scanner.next();  
		Meat meat=null;
		switch(productType) {
		case "chicken": meat=factory.getChicken();break;
		case "beef": meat=factory.getBeef();break;
		case "pork": meat=factory.getPork();break;
		default:System.out.println("sorry, your input is not correct");
		
		}
		if(meat!=null) {
			meat.play();
		}
		scanner.close();
	}

}
